<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8" />
    <title>Student Form</title>
</head>
<body>
<h3>Student Registration Form</h3>

<form
        th:action="@{/processStudentForm}"
        th:object="${student}"
        method="post"
>
    First Name: <input type="text" th:field="*{firstName}" />

    <br /><br />
    Last Name: <input type="text" th:field="${student.lastName}" />

    <br /><br />

    <!--下拉框-->
    Country:
    <select th:field="*{country}">
        <option th:value="Brazil">Brazil</option>
        <option th:value="France">France</option>
        <option th:value="Germany">Germany</option>
        <option th:value="India">India</option>
    </select>
    <br /><br />

    <!--单选实现-->
    Favorite Programming Language:
    <label>
        <input type="radio" th:field="*{favoriteLanguage}" th:value="Go" />
        Go
    </label>
    <label>
        <input type="radio" th:field="*{favoriteLanguage}" th:value="Java" />
        Java
    </label>
    <label>
        <input type="radio" th:field="*{favoriteLanguage}" th:value="Python" />
        Python
    </label>

    <br /><br />


    <!--多选实现-->
    Favorite Operation System:
    <input
            type="checkbox"
            id="Linux"
            th:field="*{favoriteOSs}"
            th:value="Linux"
    /><label for="Linux">Linux</label>
    <input
            type="checkbox"
            id="MacOS"
            th:field="*{favoriteOSs}"
            th:value="MacOS"
    /><label for="MacOS">MacOS</label>
    <input
            type="checkbox"
            id="ms"
            th:field="*{favoriteOSs}"
            th:value="'Microsoft Windows'"
    /><label for="ms">Microsoft Windows</label>
    <br /><br />
    <input type="submit" value="Submit" />

    <script src="http://localhost:35729/livereload.js"></script>
</form>
</body>
</html>
